﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@if (ViewBag.IsHomePage != null && ViewBag.IsHomePage)
           { @ViewBag.Title;
           }
           else
           { @ViewBag.Title <text>- Afrik.NET</text>;
           }</title>
    <meta name="viewport" content="width=device-width" />
    <meta name="description" content="Afrik.NET is a .NET developer community from Africa">
    @Styles.Render("~/css")
</head>
<body>
    <div class="site">
        <div class="header cf">
            <div class="logo">
                <img alt="logo" src="@Url.Content("~/static/img/logo-v1.png")">
            </div>
            <div class="nav">
                <div class="user">
                   @if (Request.IsAuthenticated)
                   {
                        <text>
                            @Html.ActionLink(User.Identity.Name, "manage", "account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })
                            @if (Roles.IsUserInRole("Administrator"))
                            { 
                                <span class="sep"></span>
                                 @Html.ActionLink("Admin", "Index", "admin")
                            }
                            <span class="sep"></span>
                            @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
                            {
                                @Html.AntiForgeryToken()
                                <a href="javascript:document.getElementById('logoutForm').submit()">Sign Out</a>
                            }
                        </text>
                   }
                   else
                   {
                        @Html.ActionLink("Join the community", "register", "account")
                        <span class="sep"></span>
                        @Html.ActionLink("Sign In", "login", "account")
                   }
                </div>
                <div class="main-menu">  @{ var controllerToLower = ViewContext.RouteData.Values["controller"].ToString().ToLower(); }
                    <ul>
                        <li @if (controllerToLower.Equals("home"))
                            {@Html.Raw("class='current'")}><a href="@Url.Action("index", "home")">Home</a></li>
                        <li @if (controllerToLower.Equals("projects"))
                            {@Html.Raw("class='current'")}><a href="@Url.Action("index", "projects")">Projects</a></li>
                        <li @if (controllerToLower.Equals("events"))
                            {@Html.Raw("class='current'")}><a href="@Url.Action("index", "events")">Events</a></li>
                        <li @if (controllerToLower.Equals("jobs"))
                            {@Html.Raw("class='current'")}><a href="@Url.Action("index", "jobs")">Jobs</a></li>
                        <li @if (controllerToLower.Equals("about"))
                            {@Html.Raw("class='current'")}><a href="@Url.Action("index", "about")">About</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="content">
            @RenderBody()
        </div>
        <div class="footer">
            &copy; @DateTime.Now.Year Afrik.NET
        </div>
    </div>

    @Scripts.Render("~/js")
    @RenderSection("scripts", required: false)

    <script>
        var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-37155586-1']); _gaq.push(['_trackPageview']);
        (function () {
            var ga = document.createElement('script'); ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
</body>
</html>
